<template>
	<view class="pad-lr-30">
	<view class="display-ce align-items flex-wrap mar-top-200" v-if="list.length==0">
		<image src="/static/img/icon10.png" class="proudct-item-icon-27" mode=""></image>
		<view class="mar-top-12 col-9 fontSize-30 text-align-center width-100">空空如也~~~</view>
	</view>
	<view class="bgfff radius-10 pad-lr-30 pad-tb-40 mar-top-20" v-for="item in list" :key="item.id">
		<view class="fontSize-28 col-6"> 订单编号：<text class="col-3">{{item.trans_order_no}}</text></view>
		<view class="fontSize-28 col-6 mar-top-20"> 付款时间：<text class="col-3">{{item.trans_time}}</text></view>
		<view class="mar-top-20 display-sb align-items">
			<view class="fontSize-28 col-6"> 服务商品：<text class="col-3">{{item.product_name}}</text></view>
			<view class="fontSize-32 col-FD6317">￥{{item.trans_amount}}</view>
		</view>
	</view>
	</view>
</template>

<script lang="ts" setup>
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { ref } from 'vue';
import {myOrder} from '../../utils/api'
onLoad(()=>{
	_myOrder()
})
onReachBottom(()=>{
	if(page.value>1){
		_myOrder()
	}
})
const page = ref(1)
const list = ref([])
const _myOrder =() =>{
	myOrder({page:page.value,limit:10}).then(res=>{
		if(res.code==1){
			list.value = list.value.concat(res.data.pos_deal.data)
			if(res.data.pos_deal.data.length>0){
				page.value++
			}
		}
	})
}
</script>

<style lang="scss">
@import 'myorder.scss';
</style>
